<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang;?>" />
<title><?php echo $navtitle;?>-<?php echo $cfg_ask_sitename;?></title>
<link href="static/style/service.css" rel="stylesheet" type="text/css" media="screen" />
<link href="static/style/ask_post.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function checkform(theform,own) {
	if(theform.ClassLevel1.selectedIndex<0) {
		alert("请选择问题分类");
		return false;
	} else if(theform.title.value == "") {
		alert("问题不能为空");
		theform.title.focus();
		return false;
	} else if(mb_strlen(theform.title.value) > 80) {
		alert("问题太长，请修改!");
		theform.title.focus();
		return false;
	} else if(theform.reward.value > own) {
		alert("悬赏的积分不能大于你拥有的积分，请重新设置悬赏积分");
		return false;
	}
}

function ShowMore(own)
{
	if(own == 1){
		document.getElementById('isshow').style.display = '';
	}else{
		document.getElementById('isshow').style.display = 'none';
	}
}
</script>
</head>
<body>
<div id="wrap">
  <?php include(DEDEASK."/templates/default/header.htm"); ?>
  <div class="subnav"><span class="fl place"><?php echo $nav?></span></div>
  <div id="main">
  	<form action="?ct=question&ac=ask_save" method="post" name="ask" onsubmit="return checkform(this,<?php echo $cfg_ml->M_Scores; ?>);">
<input type="hidden" name="scores" value="<?php echo $cfg_ml->M_Scores; ?>" />
    <div class="post_box bor1 mt10">
      <h2 class="step3"></h2>
      <div class="mt10 post_content">
        <div class="post_step3">
			<dl>
				<dt>问题名称：</dt>
				<dd>
             	<input name="title" type="text" id="title" class="post_txt2" value="<?php echo $title =empty($title)? '' : $title;?>"/>
				</dd>
				<dd>控制在6到30个字之间。(提出问题后请关注答案，并在有效期<?php echo $cfg_ask_expiredtime;?>天内结束问题)</dd>
			</dl>
			<dl>
                <dt>问题描述：</dt>
                <dd>
                  <?php GetFck("content","",400);?>
                </dd>
                <dd>问题说明越详细，回答也会越准确！</dd>
			</dl>
            <dl>
            	<dt>问题分类：</dt>
                <dd>
                  <select id=ClassLevel1 style="WIDTH: 125px"  size=8 name=ClassLevel1>
                  </select>
                  <strong class="jiantou">→</strong>
                  <select id=ClassLevel2 style="WIDTH: 90px" size=8  name=ClassLevel2>
                  </select>
                </dd>
				<script language=javascript>
				var g_ClassLevel1;
				var g_ClassLevel2;
				
				<?php echo $tids."\n".$tid2s;?>
		
				function FillClassLevel1(ClassLevel1)
				{
					for(i=0; i<class_level_1.length; i++) {
						ClassLevel1.options[i] = new Option(class_level_1[i][1], class_level_1[i][0]);
					}
					ClassLevel1.length = i;
				}
		
				function FillClassLevel2(ClassLevel2, class_level_1_id)
				{
					ClassLevel2.options[0] = new Option("不选", "");
					 count = 1;
					for(i=0; i<class_level_2.length; i++) {
						if(class_level_2[i][0].toString() == class_level_1_id) {
							ClassLevel2.options[count] = new Option(class_level_2[i][2], class_level_2[i][1]);
							count = count+1;
						}
					}
					ClassLevel2.options[0].selected = true;
					ClassLevel2.length = count;
				}
			
				function ClassLevel1_onchange()
				{
					FillClassLevel2(g_ClassLevel2, g_ClassLevel1.value);
				}
			
				function InitClassLevelList(ClassLevel1, ClassLevel2)
				{
					g_ClassLevel1=ClassLevel1;
					g_ClassLevel2=ClassLevel2;
				
					g_ClassLevel1.onchange = Function("ClassLevel1_onchange();");
					FillClassLevel1(g_ClassLevel1);
				
					var height = (g_ClassLevel1.options.length * 15 + (!(window.attachEvent && !window.opera) ? 60 : 40)) + 'px';
					g_ClassLevel1.style.height=height;
					g_ClassLevel2.style.height=height;
					ClassLevel1_onchange();
				}
			
				InitClassLevelList(document.ask.ClassLevel1, document.ask.ClassLevel2);
				</script>
				<dd>如果您的问题无法归入任何子分类，您可以只选择一级分类 。<br />
        请选择正确的分类，以使问题尽快得到解答。 </dd>
			</dl>
            <dl>
				<dt>悬赏分：</dt>
				<dd>
                <select name="reward">
                  <option value=0>0</option>
                  <option value=5>5</option>
                  <option value=10>10</option>
                  <option value=15>15</option>
                  <option value=20>20</option>
                  <option value=30>30</option>
                  <option value=50>50</option>
                  <option value=80>80</option>
                  <option value=100>100</option>
                </select>
              	</dd>
				<dd class=""><span class="jifen2">您当前的积分是 <strong><?php echo $cfg_ml->M_Scores; ?></strong> 分</span></dd>
            </dl>
            <dl>
            <dt>匿名设定：</dt>
            <dd>
            <input name="anonymous" type="checkbox" value="1" class="nmsd" />
            您可以对问题设定匿名，但您需要付出积分<?php echo $cfg_ask_anscore; ?>分。</dd>
            </dl>
            <?php
            if($gdfaq_ask == 'Y'){
            	$faqkey = array_rand($safefaqs);
            ?>
            <dl>
            	<dt>验证问题：</dt>
           		<dd><span style="line-height:29px"><?php echo $safefaqs[$faqkey]['question'];?></span> (答案:<?php echo $safefaqs[$faqkey]['answer'];?>) 
                <input name="safeanswer" type="text" id="safeanswer" class="post_txt3"/> 
                <input type="hidden" name="faqkey" value="<?php echo $faqkey;?>" />
                </dd>
            </dl>
            <?php }if(preg_match("/7/",$safe_gdopen)){?>
         	<dl>
                <dt>验证码：</dt>
                <dd>
                <input name="vdcode" type="text" id="vdcode" maxlength="100" class="post_txt3" style='text-transform:uppercase;' />
                <img src="<?php echo $cfg_ask_basehost;?>/include/vdimgck.php" alt="看不清？点击更换" align="absmiddle" style="cursor:pointer" onclick="this.src=this.src+'?'" /></p>
                </dd>
        	</dl>
      		<?php }?>
        </div>
      </div>
      <div><input  name="submit" type="submit" value=""  class="ml165 mt10 post_btn1"/></div>   
    </div>
    </form>
  </div><!--main end-->
  <?php include(DEDEASK."/templates/default/footer.htm"); ?>
</div>
</body>
</html>
